﻿using B.S.DataBase.MyProject.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using T.E.ERP.Write.API.Applicantions.Command.MyOrderMementCommand;

namespace T.E.ERP.Write.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class OrderManagementController : ControllerBase
    {
        /// <summary>
        /// 中介者
        /// </summary>
        public readonly IMediator mediator;

        public OrderManagementController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 新增订单工单
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<APIResult<int>> AddOrdermement(OrdermementCommand command)
        {
            return await mediator.Send(command);
        }
    }
}
